// 引入 request 方法，假设 request 方法已经定义在某个工具文件中
import request from '/@/utils/request';
import {
    AddScheduleInput,
    DeleteScheduleInput, 
    ListScheduleInput,
    UpdateScheduleInput,
    ScheduleInput 
} from '../models';
// 定义 API 路径枚举
enum Api {
    SysScheduleAdd = '/sysSchedule/add',
    SysScheduleDelete = '/sysSchedule/delete',
    SysScheduleDetail = '/sysSchedule/detail/{id}',
    SysSchedulePage = '/sysSchedule/page',
    SysScheduleSetStatus = '/sysSchedule/setStatus',
    SysScheduleUpdate = '/sysSchedule/update',
}

// 定义 API 方法
export const apiSysScheduleAddPost = (body?: AddScheduleInput) =>
    request({
        url: Api.SysScheduleAdd,
        method: 'post',
        data: body,
    });

export const apiSysScheduleDeletePost = (body?: DeleteScheduleInput) =>
    request({
        url: Api.SysScheduleDelete,
        method: 'post',
        data: body,
    });

export const apiSysScheduleDetailIdGet = (id: number) =>
    request({
        url: Api.SysScheduleDetail.replace('{id}', id.toString()),
        method: 'get',
    });

export const apiSysSchedulePagePost = (body?: ListScheduleInput) =>
    request({
        url: Api.SysSchedulePage,
        method: 'post',
        data: body,
    });

export const apiSysScheduleSetStatusPost = (body?: ScheduleInput) =>
    request({
        url: Api.SysScheduleSetStatus,
        method: 'post',
        data: body,
    });

export const apiSysScheduleUpdatePost = (body?: UpdateScheduleInput) =>
    request({
        url: Api.SysScheduleUpdate,
        method: 'post',
        data: body,
    });